<?php include_partial('global/navbar') ?>
<br/><br/>
<div class="next_head">
    <div class="wrap">交易明细</div>
</div>
<div class="content_nav">
    <div class="tag_nav wrap tit">
        <div class="col-xs-3 pd-n">
             <?php $all_remaining = bcadd($user_account->getRemainingMoney(),$user_account->getBlockedMoney(),sfConfig::get('app_value_bit'));?>
            <p class="tit-p p-lg">账户余额</p>
            <p class="alt-p p-lg"><?php echo sfConfig::get('app_symbol').number_format($all_remaining,2);?> </p>
        </div>
        <div class="col-xs-7 pd-n">
            <div class="col-xs-3 pd-n">
                <p class="tit-p">可用资金</p>
                <p class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($user_account->getRemainingMoney(),2)?> </p>
            </div>
            <div class="col-xs-3 pd-n">
                <p class="tit-p">冻结资金</p>
                <p class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($user_account->getBlockedMoney(),2)?> </p>
            </div>
            <div class="col-xs-3 pd-n">
                <p class="tit-p">已充值总额</p>
                <p class="alt-p"><?php echo sfConfig::get('app_symbol').number_format($user_account->getRecharge(),2)?> </p>
            </div>
            <div class="col-xs-3 pd-n">
                <p class="tit-p">已取现总额</p>
                <p class="alt-p"><?php if(empty($user_account_cash['next_money'])):?><?php $user_account_cash['next_money'] = 0?><?php endif;?><?php echo sfConfig::get('app_symbol').number_format($user_account_cash['next_money'],2)?> </p>
            </div>
        </div>
        <div class="col-xs-2 pd-n">
            <button type="button" class="btn btn-primary btn-block" onclick="window.location.href='/recharge'">充值</button>
            <button type="button" class="btn btn-default  btn-block" onclick="window.location.href='/withdrawcash'">申请提现</button>
        </div>
    </div>
    <div class="tag_nav wrap">
        <div class="col-xs-12 pd-n">
            <form class="form-inline" role="form" action="/fund/activity" method="POST">
                <div class="form-group ft-l">
                    <label class="ft-l control-label sch-lb" for="">查询时间</label>
                    <input type="text" class="ft-l form-control sch" id="startDate" onkeydown="return false;" onkeyup="return false;"   name="startDate" value="<?php echo date("Y-m-d")?>">
                </div>
                <div class="form-group ft-l">
                    <label class="ft-l control-label sch-lb" for="">到</label>
                    <input type="text" class="ft-l form-control sch" id="endDate" onkeydown="return false;" onkeyup="return false;"  name="endDate" value="<?php echo date("Y-m-d")?>">
                </div>
                <button type="submit" class="btn btn-primary">查询</button>
            </form>
        </div>
        <div class="col-xs-12 pd-n">
            <hr />
            <table class="table table-hover ">
                <thead>
                    <tr>
                        <th>日期</th>
                        <th>类型</th>
                         <th>冻结</th>
                        <th>收入</th>
                        <th>支出</th>
                        <th>余额</th>
                        <th style="width: 280px">说明</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model.ShowMoneyHistory)
                    {
                        <tr>
                            <td>@item.CreationDate </td>
                            <td>@item.Type</td>
                             <td>
                                @if (item.AmountForzen != 0)
                                {
                                    @item.AmountForzen.ToString("C2")
                                }
                            </td>
                            <td>
                                @if (item.AmountIn != 0)
                                {
                                    @item.AmountIn.ToString("C2")
                                }
                            </td>
                            <td>
                                @if (item.AmountOut != 0)
                                {
                                    @item.AmountOut.ToString("C2")
                                }
                            </td>
                            <td>@item.Balance.ToString("C2")</td>
                            <td>@Html.Raw(item.Description)</td>
                        </tr>
                    }
                </tbody>
                
            </table>
        </div>
        @Html.Raw(HelperUtils.GetPagerHtml(Request.RawUrl, Model.TotalPages, Model.CurrentPage))
    </div>
</div>

<script >
    $('#startDate').datetimepicker({
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView: 'decade'
    });
    $('#endDate').datetimepicker({
        format: 'yyyy-mm-dd',
        autoclose: true,
        minView: 'decade'
    });
    $("#10003,#10007").addClass("on");
    
</script>